// 封装购物车相关接口
import request from '@/utils/http'

// 获取购物车列表
export const getCartList = () => {
    return request({
        url: '/member/cart',
        method: 'get'
    })
}

// 加入购物车
export const addCartApi = ({skuId, count}) => {
    return request({
        url: '/member/cart',
        method: 'post',
        data:{
            skuId,
            count
        }
    })
}

// 删除购物车
export const delCartApi = (ids) => {
    return request({
        url: '/member/cart/',
        method: 'delete',
        data:{
            ids
        }
    })
}

// 合并购物车
export const mergeCartApi = (data)=>{
    return request({
        url: '/member/cart/merge',
        method:'POST',
        data
    })
}

